summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-10-09 00:27:40 +0200
committerLiam <byteslice@airmail.cc>2022-10-09 00:27:40 +0200
commit96324342438a5ce16ab9fbec6d8c17756ef166ff (patch)
tree1432040192771049aec6170b4f6e63481dae86e6
parentMerge pull request #9016 from liamwhite/drunken-schedule (diff)
downloadyuzu-96324342438a5ce16ab9fbec6d8c17756ef166ff.tar
yuzu-96324342438a5ce16ab9fbec6d8c17756ef166ff.tar.gz
yuzu-96324342438a5ce16ab9fbec6d8c17756ef166ff.tar.bz2
yuzu-96324342438a5ce16ab9fbec6d8c17756ef166ff.tar.lz
yuzu-96324342438a5ce16ab9fbec6d8c17756ef166ff.tar.xz
yuzu-96324342438a5ce16ab9fbec6d8c17756ef166ff.tar.zst
yuzu-96324342438a5ce16ab9fbec6d8c17756ef166ff.zip
-rw-r--r--src/core/core_timing.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 6c0fcb7b5..2678ce532 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -270,6 +270,7 @@ void CoreTiming::ThreadLoop() {
// There are more events left in the queue, wait until the next event.
const auto wait_time = *next_time - GetGlobalTimeNs().count();
if (wait_time > 0) {
+#ifdef _WIN32
// Assume a timer resolution of 1ms.
static constexpr s64 TimerResolutionNS = 1000000;
@@ -287,6 +288,9 @@ void CoreTiming::ThreadLoop() {
if (event.IsSet()) {
event.Reset();
}
+#else
+ event.WaitFor(std::chrono::nanoseconds(wait_time));
+#endif
}
} else {
// Queue is empty, wait until another event is scheduled and signals us to continue.